<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>创建调查问卷</title>
  <link rel="shortcut icon" href="/html/images/favicon.ico" type="image/x-icon">
  <link rel="stylesheet" type="text/css" href="/queen/Public/Home/css/global.css" />
  <link rel="stylesheet" type="text/css" href="/queen/Public/Home/css/manage.css" />
  <link rel="stylesheet" type="text/css" href="/queen/Public/Home/css/jquery-ui.css" />
  <link rel="stylesheet" type="text/css" href="/html/js/jquery.datetimepicker.css"/>

  <style>
    .loading {
      text-align: center;
      font-size: 1.2em;
      background-color: #FFFFD6;
      clear: both;
    }
    span.required:before {
      content: '*';
      color: red;
      margin-left: 5px;
      font-weight: bold;
    }
    .survey-add-option {
      line-height: 98px !important;
      text-align: center;
      font-size: 1.5em !important;
      cursor: pointer;
      color: #999;
      width: 100% !important;
    }

    .survey-form-preview-container {
      position: absolute;
      width: 100%;
      height: 100%;
      background-color: #fff;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 100;
      display: none;
    }

    .image-choice-placeholder {
      text-align: center;
      width: 146px;
      height: 184px;
      line-height: 184px;
      border: 1px dashed #ddd;
    }

    .global_right.global_form {
      float: none;
      margin: 0 auto;
    }

    .survey-detail-outer {
      width: 998px;
      margin: 20px auto;
    }

    .survey-option > span {
      visibility: hidden;
    }

    input.invalid {
      border: 1px solid red !important;
    }
    .error-icon {
      display: none;
    }
    input.invalid + .error-icon {
      position: relative;
      right: 0px;
      margin-left: 0px !important;
      margin-right: 0px !important;
      display: inline-block;
      width: 18px;
      height: 18px;
      background-position: 0px -39px;
      background-image: url(/html/images/icon1GNew.png);
    }

    input.invalid.start-time + .error-icon,
    input.invalid.end-time + .error-icon {
      margin-left: -5px !important;
      right: 15px;
    }

    .select.invalid {
      border: 1px solid red;
    }

    .row-item.question.disabled .move-handler {
      display: none;
    }

    .close label {
      cursor: pointer;
    }
  </style>

  <script src="/queen/Public/Home/js/global.js"></script>
  <script src="/queen/Public/Static/jquery-1.9.1.min.js"></script>
  <script src="/queen/Public/Home/js/jquery-ui.min.js"></script>
  <script src="/queen/Public/Home/js/jquery.fileupload.js"></script>
  <script src="/queen/Public/Home/js/aaa.js"></script>
  <script src="/queen/Public/Home/js/underscore-min.js"></script>
  <script src="/queen/Public/Home/js/backbone-min.js"></script>
  <script src="/queen/Public/Home/js/template.js"></script>
  <script src="/queen/Public/Home/js/template/public.js"></script>
  <script src="/queen/Public/Home/js/template/common.js"></script>
  <script src="/queen/Public/Home/js/template/manage_public.js"></script>
  <script src="/queen/Public/Home/js/jquery.datetimepicker.js"></script>
  <script src="/queen/Public/Home/js/moment-with-locales.min.js"></script>
  <script src="/queen/Public/Home/js/survey/survey.js"></script>
</head>

<body class="global_form">

  <!-- Batch add popup -->
  <div id="batchAddAction" class="global_dialogInfo global_dialogW600" dialogtitle="批量添加">
    <labe>每个选项请单列一行，单个选项长度不能超过255个字符</labe>
    <textarea name="options"></textarea>
    <div class="dialogSave">
      <a href="javascript://" class="btn_small btn_orange btn_80x40 saveBtn">保存</a>
      <a href="javascript://" class="btn_small btn_orange btn_80x40 cancelBtn">取消</a>
    </div>
  </div>

  <div class="global_head">
  </div>
  <div class="global_headSec">

  </div>

  <div class="loading">加载中...</div>

  <div class="global_table global_form global_formList global_icon global_width">

      <div class="global_leftMenu">
      </div>

      <div class="global_right">

        <div class="block-cover"></div>

        <div class="rightTitle font_green01">
          <em class="line"></em>创建调查问卷
          <a href="javascript:history.go(-1);" class="backBtn">返回上一级</a>
          <div class="oprBtn">
            <!--<a class="btn_small btn_green btn_autox30" href="javascript://" id="btnBack">返回</a>-->
          </div>
        </div>

        <div class="rightBody create_survey" style="display: none;">

        </div>

      </div>



  </div>

  <div class="clear"></div>

  <div class="survey-form-preview-container">

    <div class="global_right global_form">
      <div class="rightTitle font_green01">
        <em class="line"></em>预览
        <div class="oprBtn">
          <a class="btn_small btn_green btn_autox30 btnBack" href="javascript://">返回</a>
        </div>
      </div>

      <div class="survey-form-preview-content">
        <form>
          <h1 class="form-title"></h1>
          <div class="form-description"></div>
          <fieldset>

          </fieldset>

          <div class="manage_main manage_roulette">
            <div class="btnBox">
              <a class="btn_small btn_green btn_autox40" href="javascript://">提交</a>
            </div>
          </div>
        </form>
      </div>

    </div>

  </div>
  <div class="survey-detail-outer">
    <div class="global_width survey_details" style="display:none;">
      <div class="content">

      </div>
    </div>
  </div>

<input id="is_not_score" value="" type="hidden">
<input id="is_not_result" value="" type="hidden">
  <script>
    // 对话框自定义函数
    function batchAddActionDialog($dialog,closeDialog){

      var values = [];
      var currentModel = null;
      if (window.$surveyView) {
        currentModel = window.$surveyView.getCurrentSelectedModel();
        if (currentModel) {
          var fields = currentModel.get('fields');
          if (fields) {
            $.each(fields, function(idx, field) {
              if (field.other != 1) {
                if (field.title) values.push(field.title);
              }
            });
          }
        }
      }
      var oldCount = values.length;
      $('textarea', $dialog).val(values.join('\n'));

      //点击保存按钮
      $dialog.find(".dialogSave a.saveBtn").unbind("click").click(function(){
        var values = $('textarea', $dialog).val().split('\n');
        var min = window.$surveyView.getType() == 3 ? 3 : 2;
        if (values.length < min) {
          alert('至少要填写' + min + '行');
          return;
        }

        if (currentModel) {
          if (window.$surveyView.getType() == 3) {
            var newCount = values.length;
            var views = $surveyView.getViews();
            // current model index = 0
            var nextView = views[1];
            var topVote;
            if (nextView) {
              var nextModel = nextView.model;
              topVote = nextModel.get('top_vote');
            }
            if (topVote && topVote >= newCount) {
              if (confirm('将重新设置依赖关系，继续？')) {
                currentModel.setValues(values);
                window.$surveyView.updateViewIndex();

                window.$surveyView.updateTopVote();
              }
            } else {
              currentModel.setValues(values);
              window.$surveyView.updateViewIndex();

              window.$surveyView.updateTopVote();
            }
          } else {
            currentModel.setValues(values);
            window.$surveyView.updateViewIndex();
          }
        }

        closeDialog();
      });

      //点击关闭按钮
      $dialog.find(".dialogClose, .cancelBtn").unbind("click").click(function(){
        closeDialog();
      });

    }

    /////////////////////////// select event
    function fieldCountSelect($item) {
      $item.closest('.select').removeClass('invalid');
      if (window.$surveyView) window.$surveyView.updatePromotionView($item);
    }
  </script>

  <!-- Step 1 -->
  <script type="text/template" id="survey-step-1">
    <div class="manage_main">
      <div class="setbox">
        <div class="boxtitle">
          <span class="first">问卷标题</span>
        </div>
        <div class="boxbody">
          <input type="text" id="survey_name" name="survey_name" maxlength="50" required pattern="[^<>\/%!=]+" value="<%-title%>"><span class="error-icon"></span>
          <span>*</span>
        </div>
      </div>

      <div class="setbox">
        <div class="boxtitle">
          <span class="second">选择类别</span>
        </div>
        <div class="boxbody">
          <div class="chose <%if(typeof id!= 'undefined' && id) {%>readonly<%}%>">
            <a class="first survey-type <%if (typeof type == 'undefined' || type == 1) {%>active<%}%>" href="javascript://" data-type="1" data-hint="微调查：创建多题型问卷，通过用户答题获取所需信息"><span></span><b></b>微调查</a>
            <a class="sec survey-type <%if (typeof type != 'undefined' && type == 2) {%>active<%}%>" href="javascript://" data-type="2" data-hint="单题投票：创建只有一题的投票"><span></span><b></b>单题投票</a>
            <a class="fourth survey-type <%if (typeof type != 'undefined' && type == 3) {%>active<%}%>" data-type="3" href="javascript://" data-hint="多题晋级投票：每轮投票限一题，可设置多轮投票"><span></span><b></b>多题晋级投票</a>
            <a class="icon_form survey-type" <%if (typeof type != 'undefined' && type == 4) {%>active<%}%>" data-type="4" href="javascript://" data-hint="问卷表单：以表单形式，收集所需信息"><span></span><b></b>问卷表单</a>
			<!--<a class="survey-type" data-type="4" href="javascript://" data-hint="New Type: xxxx">NEW type</a>-->
          </div>
          <p class="survey-hint">微调查:创建多题型问卷，通过用户答题获取所需信息</p>
        </div>
      </div>

      <div class="setbox">
        <div class="list list_1">
          <div class="box">
            <span>开始时间</span><input type="text" class="start-time" required value="<%=start_time%>"><span class="error-icon"></span>
            <span>结束时间</span><input type="text" class="end-time" required value="<%=end_time%>"><span class="error-icon"></span><span class="tip">*</span>
          </div>
          <p class="tips">设置问卷统计时间</p>
        </div>
      </div>

      <div class="setbox">
        <div class="list list_2">
          <dl>
            <dt>设置权限</dt>
            <dd>
              <p><input type="radio" name="privacy" value="2" <%if (privacy == 2) {%>checked<%}%> <%if(typeof id!= 'undefined' && id && published==1) {%>disabled<%}%>>所有人可参与</p>
			  <p><input type="radio" name="privacy" value="3" <%if (privacy == 3) {%>checked<%}%> <%if(typeof id!= 'undefined' && id && published==1) {%>disabled<%}%>>登录人员可参与</p>
              <p><input type="radio" name="privacy" value="0" <%if (privacy == 0) {%>checked<%}%> <%if(typeof id!= 'undefined' && id && published==1) {%>disabled<%}%>>报名人员可参与</p>
              <p><input type="radio" name="privacy" value="1" <%if (privacy == 1) {%>checked<%}%> <%if(typeof id!= 'undefined' && id && published==1) {%>disabled<%}%>>签到人员可参与</p>
            </dd>
          </dl>
          <p class="tips">设置可参与答题的人员范围</p>
        </div>
      </div>
	  <div class="setbox pingfen" <%if (typeof type != 'undefined' && type != 1) {%>style="display:none"<%}%> >
        <div class="list list_2">
          <dl>
            <dt>支持评分</dt>
            <dd>
              <p><input type="radio" class="_score1" name="is_score" value="0" <%if (!is_score || is_score == 0) {%>checked<%}%> <%if(typeof id!= 'undefined' && id && published==1) {%>disabled<%}%> >不开启</p>
			  <p><input type="radio" class="_score2" name="is_score" value="1" <%if (is_score &&　is_score == 1) {%>checked<%}%> <%if(typeof id!= 'undefined' && id && published==1) {%>disabled<%}%> >开启</p>
            </dd>
          </dl>
        </div>
      </div>
		<div class="setbox pingfen" <%if (typeof type != 'undefined' && type != 1) {%>style="display:none"<%}%> >
        <div class="list list_2">
          <dl>
            <dt>查看答题结果</dt>
            <dd>
              <p><input type="radio" class="_result1" name="is_result" value="0" <%if (!is_result || is_result == 0) {%>checked<%}%>  >不支持</p>
			  <p><input type="radio" class="_result2" name="is_result" value="1" <%if (is_result &&　is_result == 1) {%>checked<%}%> >支持</p>
            </dd>
          </dl>
        </div>
      </div>
    </div>
    <div class="save"><a href="javascript://" id="survey-step-1-create"><%if(typeof id!= 'undefined' && id) {%>保存<%} else {%>创建<%}%></a></div>
  </script>

  <!-- Step 2 -->
  <script type="text/template" id="survey-step-2">
    <div class="box_title">
      <input type="text" name="title" value="<%=title%>" maxlength="50" placeholder="此处输入问卷标题" required pattern="[^<>\/%!=]+" ><span class="error-icon"></span>
      <textarea name="description" maxlength="100"  placeholder="此处输入问卷说明（限100字符）"><%=description%></textarea><span class="error-icon"></span>
    </div>

    <div class="box_title end" style="display: none;">
      <h2><%-title%><%if(title=='') {%>未命名标题<%}%></h2>
      <p><%-description%></p>
    </div>

    <div class="details">

      <div class="questions"></div>

      <ul class="choose">
        <li class="form survey-add-option">+ 添加新题目</li>
      </ul>

      <div class="choose survey-options">
        <% if (type != 4) { %>
        <a href="javascript://" class="btn survey-option" data-type="1">单选题</a>
        <a href="javascript://" class="btn survey-option" data-type="2">多选题</a>
        <a href="javascript://" class="btn survey-option" data-type="3">图片单选题</a>
        <a href="javascript://" class="btn survey-option" data-type="4">图片多选题</a>
        <% } %>
        <% if (type == 1) { %>
        <a href="javascript://" class="btn survey-option" data-type="5">单行填空题</a>
        <a href="javascript://" class="btn survey-option" data-type="6">多行填空题</a>
        <!--<a href="javascript://" class="btn survey-option" data-type="7">多项填空题</a>-->
        <a href="javascript://" class="btn survey-option" data-type="8">排序题</a>
        <% } else if (type == 4) { %>
		<a href="javascript://" class="btn survey-option" data-type="5">单行填空题</a>
        <% } %>
      </div>

      <div class="save">
        <% if (answer_count == 0 && survey_status != 0) { %>
        <a class="first" href="javascript://" id="survey-step-2-create">保存</a>
        <% } else {%>
        <a class="first" href="/html/page/survey/list.html?event_id=<%=event_id%>">返回</a>
        <% } %>
        <!--<a class="second" href="javascript://" id="survey-preview">网页/手机预览</a>-->
      </div>

    </div>

  </script>

  <script type="text/template" id="question-template">
    <div class="preview"></div>
    <div class="popbox"></div>
  </script>

  <script type="text/template" id="other-option-template">
    <dl class="other">
      <dd>其他<input type="hidden" name="other" value="1"/></dd>
      <dd><a class="delet"></a></dd>
    </dl>
  </script>

  <script type="text/template" id="relationship-option-template">
    <div class="box_list">
      <div class="list_left">
        <ul>
          <li class="title">选择选项</li>
          <li class="form">
            <select class="relation1" <%if(readonly){%>disabled<%}%>>
            <option value="">--</option>
            <option value="-1" <% if(relation.fieldId == -1){ %>selected<%}%>>任意选项</option>
            <% if (type == 1 || type == 3) { %>
            <% _.each(fields, function(field, idx){ %>
            <% if (field.other != 1) {%>
            <option value="<%=field.id%>" <% if(relation.fieldId == field.id){ %>selected<%}%> <%if(field.hide){%>style='display:none;'<%}%> title="<%-field.title%>"><%-fixOptionText(field.title)%><%if(field.title=='') {%>未命名<%}%></option>
            <% } %>
            <% }) %>
            <% if (other == 1) { %>
            <option value="-2" <% if(relation.fieldId == -2){ %>selected<%}%> <%if(ooHide){%>style='display:none;'<%}%>>其他</option>
            <% } %>
            <% } %>
            </select>
          </li>
        </ul>
        <ul>
          <li class="title">转到</li>
          <li class="form">
            <select class="relation2" <%if(readonly){%>disabled<%}%>>
            <option value="">--</option>
            <% _.each(views, function(views, idx) { %>
            <% if (idx > 0 && idx > viewIndex) {%>
            <option value="<%=idx%>" <% if(relation.modelId == idx){ %>selected<%}%> title="<%-views.model.get('title')%>"><%-fixOptionText(views.model.get('title'))%><%if(views.model.get('title')=='') {%>未命名<%}%></option>
            <% } %>
            <% }) %>
            <option value="-1" <% if(relation.modelId == -1){ %>selected<%}%>>直接结束问卷</option>
            </select>
          </li>
        </ul>
      </div>
      <%if(!readonly){%><div class="list_right"> <a class="delet relationship-delete" href="javascript://"></a> </div><%}%>
    </div>
  </script>

  <script type="text/template" id="relationship-input-option-template">
    <div class="box_list">
      <div class="list_left">
        <ul>
          <li class="title">答题转到</li>
          <li class="form">
            <select class="relation2" <%if(readonly){%>disabled<%}%>>
            <option value="">--</option>
            <% _.each(views, function(views, idx) { %>
            <% if (idx > 0 && idx > viewIndex) {%>
            <option value="<%=idx%>" <% if(relation.modelId == idx){ %>selected<%}%> title="<%-views.model.get('title')%>"><%-fixOptionText(views.model.get('title'))%><%if(views.model.get('title')=='') {%>未命名<%}%></option>
            <% } %>
            <% }) %>
            <option value="-1" <% if(relation.modelId == -1){ %>selected<%}%>>直接结束问卷</option>
            </select>
          </li>
        </ul>
      </div>
      <%if(!readonly){%><div class="list_right"> <a class="delet relationship-delete" href="javascript://"></a> </div><%}%>
    </div>
  </script>

  <!-- Single choice templates -->
  <script type="text/template" id="single-choice-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if(survey_type == 1 && required == 1) { %><span class="required"></span><% } %></h3>
    <div class="row description"><%-description%></div>
    <div class="option">
      <% _.each(fields, function(field) { %>
      <p>
        <% if (field.other != 1) { %>
        <input type="radio" name="dummyOption" disabled <%if(field.checked == 1) {%>checked<%}%>/>&nbsp;&nbsp;<%- field.title %><% if (!field.title) { %>选项<% } %>
        <% } %>
      </p>
      <% }); %>

      <% if (other == 1) { %>
      <p><input type="radio" name="dummyOption" disabled/>&nbsp;&nbsp;其他<input type="text" disabled class="other"/></p>
      <% } %>
    </div>
    <!-- move handler -->
    <% if(sortable) {%><div class="edit move-handler"></div><% } %>

    <!-- edit buttons -->
    <%if(!readonly){%>
    <div class="edit02">
      <% if (survey_type == 1 && (typeof copyEnabled == 'undefined' || copyEnabled)) {%>
      <a class="add copy" href="javascript://" title="复制"></a>
      <span></span>
      <% } %>
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
    <%}%>
  </script>
  <script type="text/template" id="single-choice-option-template">
    <dl>
		<%  if ($("#is_not_score").val()== 1) { %>
			<dd class="operate"><input type="text" class="option" name="field" value="" placeholder="选项"><input class="score" type="text" name="score" value="" placeholder="评分" pattern="[0-9]+"></dd>
		<% }else{ %>
			<dd class="operate"><input type="text" name="field" value="" placeholder="选项"></dd>
		<% } %>
      
      <dd><a class="delet"></a><a class="add"></a><a class="edit03"></a></dd>
    </dl>
  </script>
  <script type="text/template" id="single-choice-create-template">

      <div class="narr"></div>
      <h3>单项选择</h3>
      <h4>标题</h4>
      <input type="text" maxlength="200" name="title" value="<%=title%>" placeholder="未命名" required pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span>
      <h4>选项</h4>
      <div class="option-group">
        <% _.each(fields, function(field) { %>
        <% if (field.other != 1) { %>
        <dl>
		<%   if ($("#is_not_score").val()== 1) { %>
			<dd class="operate"><input type="text" class="option" name="field" data-id="<%=field.id%>" maxlength="255" value="<%= field.title %>" placeholder="选项" pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>><input type="text" class="score" name="score" data-id="<%=field.score%>" maxlength="255" value="<%= field.score %>" placeholder="评分" pattern="[0-9]+" <%if(readonly){%>readonly<%}%>><span class="error-icon"></span></dd>
		<% }else{ %>
			<dd class="operate"><input type="text" name="field" data-id="<%=field.id%>" maxlength="255" value="<%= field.title %>" placeholder="选项" pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>><span class="error-icon"></span></dd>
		<% } %>
          
		<%if(!readonly){%><dd><a class="delet" href="javascript://" style="<% if (fields.length <= minOptions) { %>display:none;<% } %>"></a><a href="javascript://" class="add"></a><a class="edit03"></a></dd><%}%>
        </dl>
        <% } %>
        <% }); %>
      </div>
      <% if (other == 1) { %>
      <dl class="other">
        <dd>其他<input type="hidden" name="other" value="1"></dd>
        <%if(!readonly){%><dd><a class="delet"></a></dd><%}%>
      </dl>
      <% } %>
      <%if(!readonly){%>
      <div class="edit04">
        <a class="batch-add" href="javascript://" UIdialogNew="batchAddAction">批量添加</a>
        <span <% if (other == 1) { %>style="display: none;"<% } %>></span>
        <a class="add-other" href="javascript://" <% if (other == 1) { %>style="display: none;"<% } %>>添加其他</a>
      </div>
      <%}%>

      <% if (survey_type == 1) {%>    
        <div class="setting">
          <div class="setting_menu">设置<span class="close"><label>收起</label><b></b></span></div>
          <div class="setting_box">
            <div class="choice">
              <% var randomId = Math.floor(Math.random() * 100000); %>
              <div><input type="checkbox" name="required" id="required-<%=randomId%>" <% if(required == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="required-<%=randomId%>">本题必答</label></div>
              <div><input type="checkbox" name="relationship" id="relationship-<%=randomId%>" <% if(relationship == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="relationship-<%=randomId%>">启用关联逻辑</label></div>
            </div>
            <div class="choice_box relationship relationship-group" <%if(relationship != 1){%>style="display:none"<%}%>></div>
            <%if(!readonly){%>
            <div class="choice_box" <%if(relationship != 1 || relationAddDisabled){%>style="display:none"<%}%>>
              <div class="btn_box">
                <a href="javascript://" class="btn_small btn_gray btn_icon add relationship-add"><span class="icon"></span>添加</a>
              </div>
            </div>
            <%}%>
          </div>
        </div>
      <% } %>
  </script>

  <!-- Multiple choice templates -->
  <script type="text/template" id="multiple-choice-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if(survey_type == 1 && required == 1) { %><span class="required"></span><% } %></h3>
    <div class="row description"><%-description%></div>
    <div class="option">
      <% _.each(fields, function(field) { %>
      <% if (field.other != 1) { %>
      <p><input type="checkbox" name="dummyOption" disabled <% if(field.checked == 1) {%>checked<%}%>/>&nbsp;&nbsp;<%- field.title %><% if (!field.title) { %>选项<% } %></p>
      <% } %>
      <% }); %>
      <% if (other == 1) { %>
      <p><input type="checkbox" name="dummyOption" disabled/>&nbsp;&nbsp;其他<input type="text" disabled class="other"/></p>
      <% } %>
    </div>
    <!-- move handler -->
    <div class="edit move-handler"></div>

    <!-- edit buttons -->
    <%if(!readonly){%>
    <div class="edit02">
      <% if (survey_type == 1 && (typeof copyEnabled == 'undefined' || copyEnabled)) {%>
      <a class="add copy" href="javascript://" title="复制"></a>
      <span></span>
      <% } %>
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
    <%}%>
  </script>
  <script type="text/template" id="multiple-choice-create-template">
    <div class="narr"></div>
    <h3>多项选择</h3>
    <h4>标题</h4>
    <input type="text" maxlength="200" name="title" value="<%=title%>" placeholder="未命名" required pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span>
    <h4>选项</h4>
    <div class="option-group">
      <% _.each(fields, function(field) { if (field.other != 1) { %>
      <dl>
        <dd><input type="text" name="field" maxlength="255" value="<%= field.title %>" placeholder="选项"pattern="^[^<>\/%!=]+" <%if(readonly){%>disabled<%}%>><span class="error-icon"></span></dd>
        <%if(!readonly){%><dd><a class="delet" href="javascript://" style="<% if (fields.length <= minOptions) { %>display:none;<% } %>"></a><a href="javascript://" class="add"></a><a href="javascript://" class="edit03"></a></dd><%}%>
      </dl>
      <% }}); %>
    </div>
    <% if (other == 1) { %>
    <dl class="other">
      <dd>其他<input type="hidden" name="other" value="1"></dd>
      <%if(!readonly){%><dd><a class="delet"></a></dd><%}%>
    </dl>
    <% } %>
    <%if(!readonly){%>
    <div class="edit04">
      <a class="batch-add" href="javascript://" UIdialogNew="batchAddAction">批量添加</a>
      <span></span>
      <a class="add-other" href="javascript://">添加其他</a>
    </div>
    <%}%>

    <% if (survey_type == 1) {%>
    <div class="setting">
      <div class="setting_menu">设置<span class="close"><label>收起</label><b></b></span></div>
      <div class="setting_box">
        <div class="choice">
          <% var randomId = Math.floor(Math.random() * 100000); %>
          <div><input type="checkbox" name="required" id="required-<%=randomId%>" <% if(required == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="required-<%=randomId%>">本题必答</label></div>
          <div><input type="checkbox" name="relationship" id="relationship-<%=randomId%>" <% if(relationship == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="relationship-<%=randomId%>">启用关联逻辑</label></div>
        </div>
        <div class="choice_box relationship relationship-group" <%if(relationship != 1){%>style="display:none"<%}%>></div>
        <%if(!readonly){%>
        <div class="choice_box" <%if(relationship != 1 || relationAddDisabled){%>style="display:none"<%}%>>
          <div class="btn_box">
            <a href="javascript://" class="btn_small btn_gray btn_icon add relationship-add"><span class="icon"></span>添加</a>
          </div>
        </div>
        <%}%>
      </div>
    </div>
    <% } %>
  </script>
  <script type="text/template" id="multiple-choice-option-create-template">
    <dl>
      <dd><input type="text" name="field" value="" placeholder="选项"></dd>
      <dd><a class="delet"></a><a class="add"></a><a class="edit03"></a></dd>
    </dl>
  </script>

  <!-- Single Line templates -->
  <script type="text/template" id="single-line-create-template">
    <div class="narr"></div>
    <h3>单行填空</h3>
    <h4>标题</h4>
    <input type="text" name="title" maxlength="200" value="<%=title%>" placeholder="未命名" required pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span>
    <h4>默认值</h4>
    <% _.each(fields, function(field) { %>
    <dl>
      <dd><input type="text" name="predefined_value" maxlength="255" value="<%=field.predefined_value%>" pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>><span class="error-icon"></span></dd>
    </dl>
    <% }) %>
    <% if (fields.length == 0) { %>
    <dl>
      <dd><input type="text" name="predefined_value" maxlength="255" value="<%=predefined_value%>" <%if(readonly){%>readonly<%}%>/></dd>
    </dl>
    <% } %>

    <% if (survey_type == 1 || survey_type == 4) {%>
    <div class="setting">
      <div class="setting_menu">设置<span class="close"><label>收起</label><b></b></span></div>
      <div class="setting_box">
        <div class="choice">
          <% var randomId = Math.floor(Math.random() * 100000); %>
          <div><input type="checkbox" name="required" id="required-<%=randomId%>" <% if(required == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="required-<%=randomId%>">本题必答</label></div>
          <% if(survey_type == 1) { %> <div><input type="checkbox" name="relationship" id="relationship-<%=randomId%>" <% if(relationship == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="relationship-<%=randomId%>">启用关联逻辑</label></div><% } %>
        </div>
        <div class="choice_box relationship relationship-group" <%if(relationship != 1){%>style="display:none"<%}%>></div>
        <%if(!readonly){%>
        <div class="choice_box" <%if(relationship != 1 || relationAddDisabled){%>style="display:none"<%}%>>
          <div class="btn_box">
            <a href="javascript://" class="btn_small btn_gray btn_icon add relationship-add"><span class="icon"></span>添加</a>
          </div>
        </div>
        <%}%>
      </div>
    </div>
    <% } %>
  </script>
  <script type="text/template" id="single-line-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if( (survey_type == 1 && required == 1) || (survey_type == 4 && required == 1) ) { %><span class="required"></span><% } %></h3>
    <% _.each(fields, function(field) { %>
    <input type="text" class="num" readonly value="<%=field.predefined_value%>"/>
    <% }) %>

    <!-- move handler -->
    <div class="edit move-handler"></div>

    <!-- edit buttons -->
    <%if(!readonly){%>
    <div class="edit02">
      <a class="add copy" href="javascript://" title="复制"></a>
      <span></span>
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
    <%}%>
  </script>

  <!-- Multiple Line templates -->
  <script type="text/template" id="multiple-line-create-template">
    <div class="narr"></div>
    <h3>多行填空</h3>
    <h4>标题</h4>
    <input type="text" maxlength="200" name="title" value="<%=title%>" placeholder="未命名" required pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span>
    <h4>默认值</h4>
    <% _.each(fields, function(field) { %>
    <dl>
      <dd><textarea name="predefined_value" class="textR" pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>><%=field.predefined_value%></textarea><span class="error-icon"></span></dd>
    </dl>
    <% }) %>

    <% if (survey_type == 1) {%>
    <div class="setting">
      <div class="setting_menu">设置<span class="close"><label>收起</label><b></b></span></div>
      <div class="setting_box">
        <div class="choice">
          <% var randomId = Math.floor(Math.random() * 100000); %>
          <div><input type="checkbox" name="required" id="required-<%=randomId%>" <% if(required == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="required-<%=randomId%>">本题必答</label></div>
          <div><input type="checkbox" name="relationship" id="relationship-<%=randomId%>" <% if(relationship == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="relationship-<%=randomId%>">启用关联逻辑</label></div>
        </div>
        <div class="choice_box relationship relationship-group" <%if(relationship != 1){%>style="display:none"<%}%>></div>
        <%if(!readonly){%>
        <div class="choice_box" <%if(relationship != 1 || relationAddDisabled){%>style="display:none"<%}%>>
          <div class="btn_box">
            <a href="javascript://" class="btn_small btn_gray btn_icon add relationship-add"><span class="icon"></span>添加</a>
          </div>
        </div>
        <%}%>
      </div>
    </div>
    <% } %>
  </script>
  <script type="text/template" id="multiple-line-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if(required == 1) { %><span class="required"></span><% } %></h3>
    <% _.each(fields, function(field) { %>
    <textarea rows="3" class="textL" readonly><%=field.predefined_value%></textarea>
    <% }) %>


    <!-- move handler -->
    <div class="edit move-handler"></div>

    <!-- edit buttons -->
    <%if(!readonly){%>
    <div class="edit02">
      <a class="add copy" href="javascript://" title="复制"></a>
      <span></span>
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
    <%}%>
  </script>

  <!-- Single Image Choice templates -->
  <script type="text/template" id="single-image-choice-create-template">
    <div class="narr"></div>
    <h3>图片单选</h3>
    <h4>标题</h4>
    <input type="text" maxlength="200" name="title" placeholder="未命名" required pattern="^[^<>\/%!=]+" value="<%=title%>" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span>
    <div class="image-choice-area option-group">
      <% _.each(fields, function(field) { %>
      <dl class="uploaded" data-id="<%=field.id%>">
        <dt><a href="#"><img src="<%=field.src%>" /></a></dt>
		<% if ($("#is_not_score").val()== 1) { %>
			<dd class="operate">
			<input type="text" maxlength="20" class="name" name="field"  value="<%=field.title%>" required pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>/>
			<input type="text" maxlength="20" class="score" name="score"   value="<%= field.score %>" placeholder="评分" pattern="[0-9]+" >
			<span class="error-icon"></span>
			</dd>
		<% }else{ %>
			<dd class="operate"><input type="text" maxlength="20" name="field" value="<%=field.title%>" required pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span></dd>
		<% } %>
          
        <%if(!readonly){%><dd><a href="javascript://" class="delet"></a><a class="edit03"></a></dd><%}%>
      </dl>
      <% }); %>
    </div>
    <%if(!readonly){%>
    <div class="drop">
      <% var random = Math.floor(Math.random() * 1000); %>
      <label class="file-upload" for="image_upload_<%=random%>" style="height: 100%;width: 100%;display: block;"><span></span>点击添加或拖动至此</label>
      <div style="visibility: hidden;"><input type="file" multiple="true" id="image_upload_<%=random%>" name="image_upload" accept="image/jpeg,image/png,image/gif" /></div>
    </div>
    <%}%>

    <% if (survey_type == 1) {%>
    <div class="setting">
      <div class="setting_menu">设置<span class="close"><label>收起</label><b></b></span></div>
      <div class="setting_box">
        <div class="choice">
          <% var randomId = Math.floor(Math.random() * 100000); %>
          <div><input type="checkbox" name="required" id="required-<%=randomId%>" <% if(required == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="required-<%=randomId%>">本题必答</label></div>
          <div><input type="checkbox" name="relationship" id="relationship-<%=randomId%>" <% if(relationship == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="relationship-<%=randomId%>">启用关联逻辑</label></div>
        </div>
        <div class="choice_box relationship relationship-group" <%if(relationship != 1){%>style="display:none"<%}%>></div>
        <%if(!readonly){%>
        <div class="choice_box" <%if(relationship != 1){%>style="display:none"<%}%>>
          <div class="btn_box">
            <a href="javascript://" class="btn_small btn_gray btn_icon add relationship-add"><span class="icon"></span>添加</a>
          </div>
        </div>
        <%}%>
      </div>
    </div>
    <% } %>

  </script>
  <script type="text/template" id="single-image-uploading-template">
    <dl class="uploading">
      <dt>
        <div class="progress-container" style="display: inline-block;width: 50px;border: 1px solid;height: 12px;margin: 24px 5px;">
          <div class="progress" style="height: 100%;background-color: blue;"></div>
        </div>
      </dt>
		<% if ($("#is_not_score").val()== 1) { %>
			<dd class="operate">
			<input type="text" class="name" name="field" maxlength="20" value="<%=title%>"  readonly/>
			<input type="text" class="score" name="score"  maxlength="20" value="" placeholder="评分" pattern="[0-9]+" >
	  		</dd>
		<% }else{ %>
			<dd class="operate"><input type="text" name="field" value="<%=title%>" maxlength="20" readonly/></dd>
		<% } %>
      
      <dd><a href="javascript://" class="delet btnRemoveOption"></a></dd>
    </dl>
  </script>
  <script type="text/template" id="single-image-uploaded-template">
    <dl class="uploaded" data-id="<%=id%>">
      <dt><a href="#"><img src="<%=src%>" /></a></dt>
		<% if ($("#is_not_score").val()== 1) { %>
			<dd class="operate">
			<input type="text" class="name" maxlength=20" name="field" value="<%=title%>" required pattern="^[^<>\/%!=]+"/>
			<input type="text" class="score" name="score"  maxlength="20" value="" placeholder="评分" pattern="[0-9]+" >
			<span class="error-icon"></span>
	  		</dd>
		<% }else{ %>
			<dd class="operate"><input type="text" maxlength=20" name="field" value="<%=title%>" required pattern="^[^<>\/%!=]+"/><span class="error-icon"></span></dd>
		<% } %>
      
      <dd><a href="javascript://" class="delet"></a><a class="edit03"></a></dd>
    </dl>
  </script>
  <script type="text/template" id="single-image-choice-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if(survey_type == 1 && required == 1) { %><span class="required"></span><% } %></h3>
    <ul>
      <% _.each(fields, function(field) { %>
      <li>
        <a href="#"><img src="<%= field.src %>" /></a>
        <p>
        <input type="radio" name="dummyField" />
        <span><%-field.title%></span>
        </p>
      <% }); %>
      <% if (_.size(fields) == 0) {%><div class="image-choice-placeholder">请在右侧面板添加图片</div><%}%>
    </ul>
    <!-- move handler -->
    <div class="edit move-handler"></div>

    <!-- edit buttons -->
    <%if(!readonly){%>
    <div class="edit02">
      <% if (survey_type == 1 && (typeof copyEnabled == 'undefined' || copyEnabled)) {%>
      <a class="add copy" href="javascript://" title="复制"></a>
      <span></span>
      <% } %>
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
    <%}%>

  </script>

  <!-- Multiple Image Choice templates -->
  <script type="text/template" id="multiple-image-choice-create-template">
    <div class="narr"></div>
    <h3>图片多选</h3>
    <h4>标题</h4>
    <input type="text" maxlength="200" name="title" placeholder="未命名" required pattern="^[^<>\/%!=]+" value="<%=title%>" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span>
    <div class="image-choice-area option-group">
      <% _.each(fields, function(field) { %>
      <dl class="uploaded" data-id="<%=field.id%>">
        <dt><a href="#"><img src="<%=field.src%>" /></a></dt>
        <dd><input type="text" maxlength="20" name="field" value="<%=field.title%>" required pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span></dd>
        <%if(!readonly){%><dd><a href="javascript://" class="delet"></a><a class="edit03"></a></dd><%}%>
      </dl>
      <% }); %>
    </div>
    <%if(!readonly){%>
    <div class="drop">
      <% var random = Math.floor(Math.random() * 1000); %>
      <label class="file-upload"  for="image_upload_<%=random%>" style="height: 100%;width: 100%;display: block;"><span></span>点击添加或拖动至此</label>
      <div style="visibility: hidden;"><input type="file" multiple="true" id="image_upload_<%=random%>" name="image_upload" accept="image/jpeg,image/png,image/gif" /></div>
    </div>
    <%}%>

    <% if (survey_type == 1) {%>
    <div class="setting">
      <div class="setting_menu">设置<span class="close"><label>收起</label><b></b></span></div>
      <div class="setting_box">
        <div class="choice">
          <% var randomId = Math.floor(Math.random() * 100000); %>
          <div><input type="checkbox" name="required" id="required-<%=randomId%>" <% if(required == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="required-<%=randomId%>">本题必答</label></div>
          <div><input type="checkbox" name="relationship" id="relationship-<%=randomId%>" <% if(relationship == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="relationship-<%=randomId%>">启用关联逻辑</label></div>
        </div>
        <div class="choice_box relationship relationship-group" <%if(relationship != 1){%>style="display:none"<%}%>></div>
        <%if(!readonly){%>
        <div class="choice_box" <%if(relationship != 1 || relationAddDisabled){%>style="display:none"<%}%>>
          <div class="btn_box">
            <a href="javascript://" class="btn_small btn_gray btn_icon add relationship-add"><span class="icon"></span>添加</a>
          </div>
        </div>
        <%}%>
      </div>
    </div>
    <% } %>
  </script>
  <script type="text/template" id="multiple-image-uploading-template">
    <dl class="uploading">
      <dt>
      <div class="progress-container" style="display: inline-block;width: 50px;border: 1px solid;height: 12px;margin: 24px 5px;">
        <div class="progress" style="height: 100%;background-color: blue;"></div>
      </div>
      </dt>
      <dd><input type="text" name="field" value="<%=title%>" maxlength="20" readonly/></dd>
      <dd><a href="javascript://" class="delet"></a></dd>
    </dl>
  </script>
  <script type="text/template" id="multiple-image-uploaded-template">
    <dl class="uploaded" data-id="<%=id%>">
      <dt><a href="#"><img src="<%=src%>" /></a></dt>
      <dd><input type="text" name="field" value="<%=title%>" maxlength="20" required pattern="^[^<>\/%!=]+"/><span class="error-icon"></span></dd>
      <dd><a href="javascript://" class="delet"></a><a class="edit03"></a></dd>
    </dl>
  </script>
  <script type="text/template" id="multiple-image-choice-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if(survey_type == 1 && required == 1) { %><span class="required"></span><% } %></h3>
    <ul>
      <% _.each(fields, function(field) { %>
      <li>
        <a href="#"><img src="<%= field.src %>" /></a>
        <p>
        <input type="checkbox" name="dummyField" />
        <span><%-field.title%></span>
        </p>
        <% }); %>
        <% if (_.size(fields) == 0) {%><div class="image-choice-placeholder">请在右侧面板添加图片</div><%}%>
    </ul>
    <!-- move handler -->
    <div class="edit move-handler"></div>

    <!-- edit buttons -->
    <%if(!readonly){%>
    <div class="edit02">
      <% if (survey_type == 1 && (typeof copyEnabled == 'undefined' || copyEnabled)) {%>
      <a class="add copy" href="javascript://" title="复制"></a>
      <span></span>
      <% } %>
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
    <%}%>
  </script>

  <!-- Multiple Input templates -->
  <script type="text/template" id="multiple-input-create-template">
    <div class="narr"></div>
    <h3>多项填空</h3>
    <h4>标题</h4>
    <input type="text" name="title" maxlength="200" placeholder="未命名" required pattern="^[^<>\/%!=]+"/><span class="error-icon"></span>
    <h4>选项</h4>
    <div class="option-group">
      <% _.each(fields, function(field) { %>
      <dl>
        <dd><input type="text" maxlength="255" name="field" value="<%=field.title%>" placeholder="选项" pattern="^[^<>\/%!=]+"/></dd>
        <dd><a href="javascript://" class="delet"></a><a href="javascript://" class="add"></a><a class="edit03"></a></dd>
      </dl>
      <% }); %>
    </div>

  </script>
  <script type="text/template" id="multiple-input-option-create-template">
    <dl>
      <dd><input type="text" name="field" value="" placeholder="选项"/></dd>
      <dd><a class="delet"></a><a class="add"></a><a class="edit03"></a></dd>
    </dl>
  </script>
  <script type="text/template" id="multiple-input-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if(required == 1) { %><span class="required"></span><% } %></h3>
    <div class="option">
      <% _.each(fields, function(field) { %>
      <p><%- field.title %><%if(field.title=='') {%>选项<%}%></p><input type="text" readonly/>
      <% }); %>
    </div>
    <!-- move handler -->
    <div class="edit move-handler"></div>

    <!-- edit buttons -->
    <div class="edit02">
      <a class="add copy" href="javascript://" title="复制"></a>
      <span></span>
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
  </script>

  <!-- Sorting templates -->
  <script type="text/template" id="sorting-create-template">
    <div class="narr"></div>
    <h3>排序题</h3>
    <h4>标题</h4>
    <input type="text" name="title" maxlength="200" placeholder="未命名" required pattern="^[^<>\/%!=]+" value="<%=title%>" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span>
    <h4>选项</h4>
    <div class="option-group">
      <% _.each(fields, function(field) { %>
      <dl>
        <dd><input type="text" maxlength="255" name="field" value="<%=field.title%>" placeholder="未设置" pattern="^[^<>\/%!=]+" <%if(readonly){%>readonly<%}%>/></dd>
        <%if(!readonly){%><dd><a href="javascript://" class="delet"></a><a href="javascript://" class="add"></a><a class="edit03"></a></dd><%}%>
      </dl>
      <% }); %>
    </div>
    <%if(!readonly){%>
    <div class="edit04">
      <a class="batch-add" href="javascript://" UIdialogNew="batchAddAction">批量添加</a>
    </div>
    <%}%>

    <% if (survey_type == 1) {%>
    <div class="setting">
      <div class="setting_menu">设置<span class="close"><label>收起</label><b></b></span></div>
      <div class="setting_box">
        <div class="choice">
          <% var randomId = Math.floor(Math.random() * 100000); %>
          <div><input type="checkbox" name="required" id="required-<%=randomId%>" <% if(required == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="required-<%=randomId%>">本题必答</label></div>
          <div><input type="checkbox" name="relationship" id="relationship-<%=randomId%>" <% if(relationship == 1) { %>checked<%}%> <%if(readonly){%>disabled<%}%>/><label for="relationship-<%=randomId%>">启用关联逻辑</label></div>
        </div>
        <div class="choice_box relationship relationship-group" <%if(relationship != 1){%>style="display:none"<%}%>></div>
        <%if(!readonly){%>
        <div class="choice_box" <%if(relationship != 1 || relationAddDisabled){%>style="display:none"<%}%>>
          <div class="btn_box">
            <a href="javascript://" class="btn_small btn_gray btn_icon add relationship-add"><span class="icon"></span>添加</a>
          </div>
        </div>
        <%}%>
      </div>
    </div>
    <% } %>
  </script>
  <script type="text/template" id="sorting-option-create-template">
    <dl>
      <dd><input type="text" maxlength="255" name="field" placeholder="未设置" pattern="^[^<>\/%!=]+"/></dd>
      <dd><a href="javascript://" class="delet"></a><a href="javascript://" class="add"></a><a class="edit03"></a></dd>
    </dl>
  </script>
  <script type="text/template" id="sorting-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if(required == 1) { %><span class="required"></span><% } %></h3>
    <div class="option">
      <% _.each(fields, function(field, idx) { %>
      <p>选项<%=(idx + 1)%>.&nbsp;<%- field.title %><%if(field.title=='') {%>未设置<%}%></p>
      <% }); %>
    </div>
    <!-- move handler -->
    <div class="edit move-handler"></div>

    <!-- edit buttons -->
    <%if(!readonly){%>
    <div class="edit02">
      <a class="add copy" href="javascript://" title="复制"></a>
      <span></span>
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
    <%}%>
  </script>

  <!-- Promotion templates -->
  <script type="text/template" id="promotion-create-template">
    <div class="narr"></div>
    <h3>多题晋级投票</h3>
    <h4>标题</h4>
    <input type="text" name="title" maxlength="200" placeholder="未命名" required pattern="^[^<>\/%!=]+" value="<%=title%>" <%if(readonly){%>readonly<%}%>/><span class="error-icon"></span>
  </script>
  <script type="text/template" id="promotion-preview-template">
    <h3><label class="model-index"><%=viewIndex%>.</label>&nbsp;<%-title%><%if(title=='') {%>未命名<%}%><% if(required == 1) { %><span class="required"></span><% } %></h3>
    <div class="option">
      <p> 该题将关联投票结果：</p>
      <div class="text"> <b>第<%=relatedIndex%>题选项中得票数量前</b>
        <div class="surveydetails_select" UIselect="click">
          <div class="select select_big select_w90" selectCallback="fieldCount"> <span class="arrow"></span>
            <div class="bar"><% if (selectTopVote != 0) {%><%=selectTopVote%><% } else { %>请选择<% } %></div>
            <%if(!readonly){%>
            <div class="downlist">
              <ul UIscroll="120" id="event_uladdress_grade1">
                <% if (typeof topVote != 'undefined') {%>
                  <% for(var i = 2; i < topVote; i++) { %>
                  <li><%=i%></li>
                  <% } %>
                <% } %>
              </ul>
            </div>
            <%}%>
          </div>
          <div class="clear"></div>
        </div>
        <b>项作为该题的选项；</b></div>
    </div>
    <!-- edit buttons -->
    <%if(!readonly){%>
    <div class="edit02">
      <a class="delet delete" href="javascript://" title="删除"></a>
    </div>
    <%}%>
  </script>
</body>
</html>